import request from '@/utils/request'
import { API_CONFIG } from '@/config'

// 获取菜单列表
export function getMenuList(params) {
    return request({
        url: API_CONFIG.MENU_LIST,
        method: 'get',
        params
    })
}

// 新增菜单
export function addMenu(data) {
    return request({
        url: API_CONFIG.MENU_ADD,
        method: 'post',
        data
    })
}

// 更新菜单
export function updateMenu(data) {
    return request({
        url: API_CONFIG.MENU_UPDATE,
        method: 'put',
        data
    })
}

// 删除菜单
export function deleteMenu(id) {
    return request({
        url: `${API_CONFIG.MENU_DELETE}/${id}`,
        method: 'delete'
    })
}

// 更新菜单状态
export function updateMenuStatus(id, status) {
    return request({
        url: API_CONFIG.MENU_UPDATE_STATUS,
        method: 'put',
        data: { id, status }
    })
} 